UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CwKe+a/GLCs+iVQyjFjc+v0s+0pVtFWD6sjZo+VlhHc=' 
WHERE 
  key_id = '3cf1b61e2c4aa9e46b021a2db990684f7477944310cae6db359e0de4679f4598' 
  AND (
    token = 'CwKe+a/GLCs+iVQyjFjc+v0s+0pVtFWD6sjZo+VlhHc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031