UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MlnK6EBN7Fzke/p28ksUnbH4fM9DMgp3kNEI8dRkw7w=' 
WHERE 
  key_id = '9e9796384770358496c5b368e47623f282db3a79fb516ea7468eae45044683c0' 
  AND (
    token = 'MlnK6EBN7Fzke/p28ksUnbH4fM9DMgp3kNEI8dRkw7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061