UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AFKIgpe+F7dy9V4d8rJYEUVU1NxO01Ln7W5oVLbHHnA=' 
WHERE 
  key_id = 'ed3b0cd321b7c68ca77376b76a47ed408f635be9466a322b8ec839de232d47d0' 
  AND (
    token = 'AFKIgpe+F7dy9V4d8rJYEUVU1NxO01Ln7W5oVLbHHnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026