UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nopmawEU9KDuywAu1k6qFbpGukVKMctSudrtVF49pNk=' 
WHERE 
  key_id = '13ebf7d216bbb418b7e8ca444efbff2014ab50e72417be6293dc4d066092e4ff' 
  AND (
    token = 'nopmawEU9KDuywAu1k6qFbpGukVKMctSudrtVF49pNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019