UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I4upIE++18lfW2a+Q/142aVpEGGNPAbWRKbiYWm7N80=' 
WHERE 
  key_id = '105bce080c745f8609f2e34eb1608bc87fbcbbfd4841ee9b96c35195d2af5e0d' 
  AND (
    token = 'I4upIE++18lfW2a+Q/142aVpEGGNPAbWRKbiYWm7N80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029