UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j6FvYIz5HOuI2XgHmo/LSNSNbYIHpHZqHGlj6ng+eE0=' 
WHERE 
  key_id = '07120823b0b40cc0d95ed510f3059c1b6e8383dfa9c6ea2a58944d6b989e14ed' 
  AND (
    token = 'j6FvYIz5HOuI2XgHmo/LSNSNbYIHpHZqHGlj6ng+eE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058