UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fv7CfZVNdE4qCDSYY8iNjv0XQZ9P1V50pLjjOt8fUFw=' 
WHERE 
  key_id = '5e4670819da39e3b8caa15864e954a5411888e17c8ce433ae71386d74b3eff2c' 
  AND (
    token = 'fv7CfZVNdE4qCDSYY8iNjv0XQZ9P1V50pLjjOt8fUFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024