UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pzR/PlEMnekFO8p6ssMQI4pjzbPvmadWy2HUvah4ZcU=' 
WHERE 
  key_id = '8f5fdf1765667afeeacbe277e3a8be1593decaa35d35ff23483bcc708d3450a9' 
  AND (
    token = 'pzR/PlEMnekFO8p6ssMQI4pjzbPvmadWy2HUvah4ZcU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016