UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5UplwD5Wqtsw2HMSmcUcDAOydDywa+zHrxSkjtmLy1w=' 
WHERE 
  key_id = 'ab8f5933216b82b095c3f8864376921ffd5f57cb676192db530b3b9ad055171a' 
  AND (
    token = '5UplwD5Wqtsw2HMSmcUcDAOydDywa+zHrxSkjtmLy1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033