UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ou+hf3EtBE/AaTBefGSnQQUF2zk/mc9uRZaD1F7MlE4=' 
WHERE 
  key_id = '2faf5b890524f5d39653383aa4a199ef77847c69e3ea09145b5878c3c0fd2dba' 
  AND (
    token = 'ou+hf3EtBE/AaTBefGSnQQUF2zk/mc9uRZaD1F7MlE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039