UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fV3ZtXZ+nyLLgeoy2s4PqgHJAW7jXcGAp6LVLUkVbTw=' 
WHERE 
  key_id = '96f225bcaf7e6c48c4a29a6235e3b8847ffa6ca80f48e238f195a702ec025363' 
  AND (
    token = 'fV3ZtXZ+nyLLgeoy2s4PqgHJAW7jXcGAp6LVLUkVbTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023