UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5jKnxOaLQwVoZ9/0zQ8KvhNlPqhsl505mgGQRMeSma0=' 
WHERE 
  key_id = '2376a0099b0664d94853b747d7d144cff19e1dd548c48e9f5790edacb4490ff6' 
  AND (
    token = '5jKnxOaLQwVoZ9/0zQ8KvhNlPqhsl505mgGQRMeSma0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032