UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HaRJsk//+Wmtq+pUOH08FNV3cIwrELfG/Z1pJLIsU58=' 
WHERE 
  key_id = '7a69bb321f0805339406efbbf0bb490102eaf3de8297928b33987e642a51dd74' 
  AND (
    token = 'HaRJsk//+Wmtq+pUOH08FNV3cIwrELfG/Z1pJLIsU58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032