UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '906NTQ6vyCsU06KKwYQkxnOfmi8xZ6fEQV7NHrgsFYg=' 
WHERE 
  key_id = '5ecadb8573c398509f9b5dc8ce30d3e5f9dab37a530158be7793444621f9d6df' 
  AND (
    token = '906NTQ6vyCsU06KKwYQkxnOfmi8xZ6fEQV7NHrgsFYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022