UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U4SfkKcFukSIOtxBb6hrIiSQH48yZVIK+TrFYDxjKqc=' 
WHERE 
  key_id = '54cd5e6f8449345137c4753a155d92717a1ffffc5febbd94ae3ae0a09e1ad2cd' 
  AND (
    token = 'U4SfkKcFukSIOtxBb6hrIiSQH48yZVIK+TrFYDxjKqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037