UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cbywHgHUfPvyD73NRGwaLfaZ9RAd6aRjCPKGHqp1cP0=' 
WHERE 
  key_id = '8acf283d26ce6be933a3039ef7da7360ff0d0ef4b5b599465493bb1d39ebd0c1' 
  AND (
    token = 'cbywHgHUfPvyD73NRGwaLfaZ9RAd6aRjCPKGHqp1cP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051