UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DN1q4rv6sHx/1TWuz07wQctUHsowG/UfxK7chH99fTk=' 
WHERE 
  key_id = '930383973c81c20f0c26b1c1db1db45973c3a33cc4f2edf0a0fb2b0cb6d91bf6' 
  AND (
    token = 'DN1q4rv6sHx/1TWuz07wQctUHsowG/UfxK7chH99fTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025