UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sQdpXucWIuZH44zVFM29fqEH4mCW9OuXcUbKXmrElT4=' 
WHERE 
  key_id = '0f0d85d3685901885d4566c0400d942dd4957252e806ef26d43ea9942e1ef61e' 
  AND (
    token = 'sQdpXucWIuZH44zVFM29fqEH4mCW9OuXcUbKXmrElT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049