UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b5baVvtJhPNkNnAVrLWx+wGzOdidt1eZMLq+2mEtVTY=' 
WHERE 
  key_id = '467edfea8088b9e2b17bb62b7d764d5b9ca0e0630b43e2c1addce3240a6d6c8e' 
  AND (
    token = 'b5baVvtJhPNkNnAVrLWx+wGzOdidt1eZMLq+2mEtVTY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021