UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EkS7gEWPO2XVQLDlXjS9VSLYi5a7Q1CQdQwaJZ2bfSw=' 
WHERE 
  key_id = 'd928ec581333ba0dcd7a70e63f9bac8ce8ec81e9eb1f41e78055ac1a3df5ca43' 
  AND (
    token = 'EkS7gEWPO2XVQLDlXjS9VSLYi5a7Q1CQdQwaJZ2bfSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030