UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HJqxh6MNYn+dMIlNKYzAzNh+XF+FDTjDRDli6L/ffNw=' 
WHERE 
  key_id = 'a4a3c8b5e8e01f61cdda0b874ab1cb08f71470734ba0b32a6f2955ccbb141b77' 
  AND (
    token = 'HJqxh6MNYn+dMIlNKYzAzNh+XF+FDTjDRDli6L/ffNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033