UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6rujuCxG9T8dB8AuhV/jzJGrO9oUe8aqFxcEiPGyZOQ=' 
WHERE 
  key_id = 'b3c99aed4eb1e24828f8fe07778ab20a5a8627ccfb2f4784e09e50ba56c68f3b' 
  AND (
    token = '6rujuCxG9T8dB8AuhV/jzJGrO9oUe8aqFxcEiPGyZOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027