UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cqud/hHGRwRzgprp/i39Xs96EmED0Kmk/rPHyzI5UyY=' 
WHERE 
  key_id = 'd1b4331b69f6f278b9fd52f5dc2c6e47ea24316ab7e9caaf8c0276742d8d68e7' 
  AND (
    token = 'Cqud/hHGRwRzgprp/i39Xs96EmED0Kmk/rPHyzI5UyY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021