UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P68W1WtVeXudoR1YnUIJ25w4tkLzJ9/H6yyjfo0B65o=' 
WHERE 
  key_id = '3f89cbd73224279b3d1697a2a7d0e307470a6dbba2dd0f3cb6061e3836ff941a' 
  AND (
    token = 'P68W1WtVeXudoR1YnUIJ25w4tkLzJ9/H6yyjfo0B65o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023