UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pk4nz/EFPV3PEE9BQbK/O5V1kgOLRhupuMrKL3IxQKQ=' 
WHERE 
  key_id = 'ca25c31f5157b7775ba5dfdd0bbeb1db9ec73723ee3bd3acf69c41fa30eae2eb' 
  AND (
    token = 'pk4nz/EFPV3PEE9BQbK/O5V1kgOLRhupuMrKL3IxQKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031