UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F1YuFlqfFfqn4PfmkUmh/SaScgaA2i/XSKaJVMjWvsk=' 
WHERE 
  key_id = '2a0d5b60bd36a5f501e0275aa217ce097c0d45cc323c9168f6703600a3e5461a' 
  AND (
    token = 'F1YuFlqfFfqn4PfmkUmh/SaScgaA2i/XSKaJVMjWvsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020