UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zILlwd/XPJhArUiQhprkDfypXRXkforZKac9UJ6P6DQ=' 
WHERE 
  key_id = '7c821fd4de453abff4a8adbcdd2931d6d642c4800a52290507669771b86a1554' 
  AND (
    token = 'zILlwd/XPJhArUiQhprkDfypXRXkforZKac9UJ6P6DQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027