UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eCfFEYUu4KSbtGTZ/cQQxHYAvrLrFGg9/WAUH2l19UA=' 
WHERE 
  key_id = '2db9f42f4dd8a15199ed2208cbed5607c02f93c8a299e46c0e130162db204ec8' 
  AND (
    token = 'eCfFEYUu4KSbtGTZ/cQQxHYAvrLrFGg9/WAUH2l19UA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025