UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w8i2ac1Y3PQrJbjv/O4LkHPdFlL3/mKVMFibNF2Hilg=' 
WHERE 
  key_id = 'ab4c42b60764bee4c61a5f6ba0eaa9978a01962dcb1aebc2f0d49aa49406ac73' 
  AND (
    token = 'w8i2ac1Y3PQrJbjv/O4LkHPdFlL3/mKVMFibNF2Hilg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023