UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L28VXY8lJW2UDfsGOWw9GUqsUD0+Wg6tfmfFPUvscik=' 
WHERE 
  key_id = '9bcec39a4f323cd1cd07ffe6a616bba6d1d1bebdd6fadaf7d596e700c60ba1a1' 
  AND (
    token = 'L28VXY8lJW2UDfsGOWw9GUqsUD0+Wg6tfmfFPUvscik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031