UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rxa9fag85/jGhhckylJRDyl2fbXz41seiE3yQIF+lOU=' 
WHERE 
  key_id = '3dfc77e9afc2e731da5c8126d63f27cc54f4dadde154b848304668f4dfa62cd1' 
  AND (
    token = 'rxa9fag85/jGhhckylJRDyl2fbXz41seiE3yQIF+lOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028