UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zLsyd1iroaUtpQKHeCXJZNp58ZaMu8KlmsWjMRsN4BQ=' 
WHERE 
  key_id = '3152cb5ded29979dc0fb3bb4f9aba2402a47f7ed4929d1004a63626c8b6627dc' 
  AND (
    token = 'zLsyd1iroaUtpQKHeCXJZNp58ZaMu8KlmsWjMRsN4BQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032