UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IhcnRyk+watEcOytQgbR0npCA+vqUhj59wIpi242zxg=' 
WHERE 
  key_id = '1c96ea9a5d2f4db4a20b304491dbe06a42124cc9036016ee5af5073a76a99bdf' 
  AND (
    token = 'IhcnRyk+watEcOytQgbR0npCA+vqUhj59wIpi242zxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035