UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0YT3iLyxDR2MRPmRyuR21tgp+V3mlM8VPMhRs4KJxoU=' 
WHERE 
  key_id = 'e91a22009e825af737ab9e4784ef54426ce02e028c8cb06a4047bcc218a4eca1' 
  AND (
    token = '0YT3iLyxDR2MRPmRyuR21tgp+V3mlM8VPMhRs4KJxoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049