UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5dd7sWXQnqpSqz5LqBaJADUV+GBLsWqvmWgLmYik5cQ=' 
WHERE 
  key_id = '86596567b26aa5e5ee28eef06e9fc7afec460fa6a2a5f2ffe082156842ace5f7' 
  AND (
    token = '5dd7sWXQnqpSqz5LqBaJADUV+GBLsWqvmWgLmYik5cQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030