UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QZCC/LhTbP32/gwqY9JgVREfAAL6P8izQYZV/GjvHzA=' 
WHERE 
  key_id = '6c6944a4917c039891735346baf9b39d17dd13d424685fd4d585a25e10c304d3' 
  AND (
    token = 'QZCC/LhTbP32/gwqY9JgVREfAAL6P8izQYZV/GjvHzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032