UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0K0QhH7vvR9cSr8YTuMhB5FwzJBPJ6W/008V11jBbDU=' 
WHERE 
  key_id = 'ad067cc6a2e6ebe66666d7a0b0eff252df7c39467825bbab50a1f29d30ed9e56' 
  AND (
    token = '0K0QhH7vvR9cSr8YTuMhB5FwzJBPJ6W/008V11jBbDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050