UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hcvEEnRWlGJCGNbTQ6esBvmbOEwWQZOErMOYMDhZLvM=' 
WHERE 
  key_id = '438bd08b45960d85a5ebfe93f394b03d77547024694a9b7e42ea9195a16dcdc9' 
  AND (
    token = 'hcvEEnRWlGJCGNbTQ6esBvmbOEwWQZOErMOYMDhZLvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015